<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select($event)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref='multipleTable' :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.emwplistcost.main_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('wplistcostresult')">
                <el-table-column show-overflow-tooltip :prop="'wplistcostresult'" :label="$t('entities.emwplistcost.main_grid.columns.wplistcostresult')" :width="25"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.wplistcostresult')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.wplistcostresult}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('itemname')">
                <el-table-column show-overflow-tooltip :prop="'itemname'" :label="$t('entities.emwplistcost.main_grid.columns.itemname')" :width="240"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.itemname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emitem' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emitem-tab-exp-view', height: 0,width: 0,title: $t('entities.emitem.views.tabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            { pathName: 'emservices', parameterName: 'emservice' },
            ]
            ,parameters: [
            { pathName: 'emitems', parameterName: 'emitem' },
            { pathName: 'tabexpview', parameterName: 'tabexpview' }
            ]}" valueitem="itemid">
                            <span>{{row.itemname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('labservicename')">
                <el-table-column show-overflow-tooltip :prop="'labservicename'" :label="$t('entities.emwplistcost.main_grid.columns.labservicename')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.labservicename')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emservice' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emservice-tab-exp-view', height: 0,width: 0,title: $t('entities.emservice.views.tabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'emservices', parameterName: 'emservice' },
            { pathName: 'tabexpview', parameterName: 'tabexpview' }
            ]}" valueitem="labserviceid">
                            <span>{{row.labservicename}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('wplistcosteval')">
                <el-table-column show-overflow-tooltip :prop="'wplistcosteval'" :label="$t('entities.emwplistcost.main_grid.columns.wplistcosteval')" :width="240"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.wplistcosteval')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.wplistcosteval"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('price')">
                <el-table-column show-overflow-tooltip :prop="'price'" :label="$t('entities.emwplistcost.main_grid.columns.price')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.price')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.price"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taxrate')">
                <el-table-column show-overflow-tooltip :prop="'taxrate'" :label="$t('entities.emwplistcost.main_grid.columns.taxrate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.taxrate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.taxrate" tag='CADAB38AEA0249DDA40C36287E0E187D' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('unitname')">
                <el-table-column show-overflow-tooltip :prop="'unitname'" :label="$t('entities.emwplistcost.main_grid.columns.unitname')" :width="130"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.unitname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='pfunit' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'pfunitedit-view', height: 0,width: 500,title: $t('entities.pfunit.views.editview.title'),placement: 'DRAWER_RIGHT', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'pfunits', parameterName: 'pfunit' },
            { pathName: 'editview', parameterName: 'editview' }
            ]}" valueitem="unitid">
                            <span>{{row.unitname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('unitrate')">
                <el-table-column show-overflow-tooltip :prop="'unitrate'" :label="$t('entities.emwplistcost.main_grid.columns.unitrate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.unitrate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.unitrate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('intunitflag')">
                <el-table-column show-overflow-tooltip :prop="'intunitflag'" :label="$t('entities.emwplistcost.main_grid.columns.intunitflag')" :width="130"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.intunitflag')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.intunitflag" tag='YesNo' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('listprice')">
                <el-table-column show-overflow-tooltip :prop="'listprice'" :label="$t('entities.emwplistcost.main_grid.columns.listprice')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.listprice')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.listprice"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('discnt')">
                <el-table-column show-overflow-tooltip :prop="'discnt'" :label="$t('entities.emwplistcost.main_grid.columns.discnt')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.discnt')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.discnt"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('unitdesc')">
                <el-table-column show-overflow-tooltip :prop="'unitdesc'" :label="$t('entities.emwplistcost.main_grid.columns.unitdesc')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.unitdesc')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.unitdesc}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('pricecdt')">
                <el-table-column show-overflow-tooltip :prop="'pricecdt'" :label="$t('entities.emwplistcost.main_grid.columns.pricecdt')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.pricecdt')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.pricecdt}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('rempname')">
                <el-table-column show-overflow-tooltip :prop="'rempname'" :label="$t('entities.emwplistcost.main_grid.columns.rempname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.rempname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.rempname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('adate')">
                <el-table-column show-overflow-tooltip :prop="'adate'" :label="$t('entities.emwplistcost.main_grid.columns.adate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.adate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.adate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('begindate')">
                <el-table-column show-overflow-tooltip :prop="'begindate'" :label="$t('entities.emwplistcost.main_grid.columns.begindate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.begindate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD" :data="row.begindate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('enddate')">
                <el-table-column show-overflow-tooltip :prop="'enddate'" :label="$t('entities.emwplistcost.main_grid.columns.enddate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.enddate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD" :data="row.enddate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('itemdesc')">
                <el-table-column show-overflow-tooltip :prop="'itemdesc'" :label="$t('entities.emwplistcost.main_grid.columns.itemdesc')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.itemdesc')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.itemdesc}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('uagridcolumn1')">
                <el-table-column :column-key="'uagridcolumn1'" fixed="right" :label="$t('entities.emwplistcost.main_grid.columns.uagridcolumn1')" :width="150"  :align="'right'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplistcost.main_grid.columns.uagridcolumn1')}}
                      </span>
                    </template>
                    <template slot-scope="scope">
                        <div style="text-align: center;">
                          <a v-show="scope.row.Edit.visabled" :disabled="scope.row.Edit.disabled" @click="uiAction(scope.row, 'Edit', $event)" :title="$t('entities.emwplistcost.main_grid.uiactions.edit')">
                            <i class='fa fa-edit'></i>
                            {{$t('entities.emwplistcost.main_grid.uiactions.edit')}}
                          </a>
                          <divider v-show="scope.row.Remove.visabled" type='vertical'></divider>
                          <a v-show="scope.row.Remove.visabled" :disabled="scope.row.Remove.disabled" @click="uiAction(scope.row, 'Remove', $event)" :title="$t('entities.emwplistcost.main_grid.uiactions.remove')">
                            <i class='fa fa-remove'></i>
                            {{$t('entities.emwplistcost.main_grid.uiactions.remove')}}
                          </a>
                        </div>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class='grid-pagination' v-show="items.length > 0">
            <page class='pull-right' @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>